COSC 2P91
Sockets Week 10a
Brock University
Brock University (Week 10a) Sockets 1 / 14
COSC 2P91 Sockets Week 10a Brock University Brock University - - PowerPoint PPT Presentation
COSC 2P91 Sockets Week 10a Brock University Brock University (Week 10a) Sockets 1 / 14 Socket programming Network programming is (of course) a pretty large topic, with numerous levels of protocols, and multiple options at each level. Peer
Brock University (Week 10a) Sockets 1 / 14
Brock University (Week 10a) Sockets 2 / 14
◮ Connection-oriented typically means a byte stream approach (as
◮ Compare the operations of web servers to (simple) DNS servers Brock University (Week 10a) Sockets 3 / 14
◮ Think of a socket as an end-point handle for communication ◮ It’s similar in use to a file handle, except it’s an entry/exit point for a
◮ Technically, the connection will be identified by the IP addresses and
◮ Of course, this is an integral part of any other remotely useful IO.
Brock University (Week 10a) Sockets 4 / 14
◮ It also isn’t very portable ⋆ I’m super cereal here
Brock University (Week 10a) Sockets 5 / 14
◮ If we aren’t dealing with blocking IO, we can potentially maintain a
◮ I should have already explained datagrams by now ◮ If not, imagine writing down messages onto paper airplanes and then
⋆ Maybe they get to their intended recipient ⋆ Maybe they fall into the mud ⋆ If you want to send another message, it’s an independent event from
⋆ If you throw two airplanes, there’s no way to be certain which will
Brock University (Week 10a) Sockets 6 / 14
Brock University (Week 10a) Sockets 7 / 14
◮ Basically, the server and client reside on the same computer
Brock University (Week 10a) Sockets 8 / 14
◮ They might even provide additional libraries for specific uses, like
Brock University (Week 10a) Sockets 9 / 14
Brock University (Week 10a) Sockets 10 / 14
Brock University (Week 10a) Sockets 11 / 14
Brock University (Week 10a) Sockets 12 / 14
◮ You could either explicitly communicate with the SMTP server, or just
◮ Combine it with CGI, and you can very easily create things like
Brock University (Week 10a) Sockets 13 / 14
Brock University (Week 10a) Sockets 14 / 14