A Socket Tutorial in Python and Java. While I've included files for setting up servers in Python and Java, and clients in Python and Java, I intend to only go over a Python server with a Java client. Feel free to play with these as you will.
Read the corresponding web version here.
##Tutorial:
- What are sockets?
- http://en.wikipedia.org/wiki/Network_socket
- An endpoint of a network communication
- Composed/identified by an address and port.
- Connection Process: http://www.tutorialspoint.com/images/perl_socket.jpg
- Server Sockets: Python
- User programs' port numbers should be >1000
- creation, bind, listen, accept, , close
- [Client] Sockets: Java
- HOST and PORT must match the server
- creation, connection, , close
- Sending and receiving data to/from a host: echoServer
- Sending and receiving data to/from a host: chat service
- More with Sockets
- Threading: see Baker's presentation next week
- ObjectOutputStream and ObjectInputStream
- Examples
- GUI Chat (see 4. ChatGUI directory)
- Chess (https://github.com/koceskik/Chess.git)
- Conway's Game of Life (https://github.com/devanp92/Concurrent-Game-of-Life)
####References
- Python socket documentation: https://docs.python.org/2/library/socket.html
- Java socket tutorial: http://docs.oracle.com/javase/tutorial/networking/sockets/
- Java socket API: http://docs.oracle.com/javase/7/docs/api/java/net/Socket.html