Home » questions » TCP Client/Server "Simultaneous" execution. If connection made and server sends before client's sel

TCP Client/Server "Simultaneous" execution. If connection made and server sends before client's sel

2006-08-10 13:50:38, Category: Programming & Design
If the server sends after connection to client but before client enters select() call can I be sure that the data will be ready for reading (buffered) once the client does hit the select call? I am talking 5 s. between connection and select() call on the client at max. I have a need to send init data from one process to another (server to client) when both processes are executed near simultaneously (server then client as daemon's in a shell script).

Answers

  1. land_bus

    On 2006-08-13 06:05:08


    If you are using java i can help. Why are you using the select function with client side technology? Ive never had to use that function on the client side. But i help you anyway. If this is java then when you call select and youre SelectionKey set turn it into a iterator by calling the iterator function and then get each key in the iterator. Once you have a selectionkey call the function isReadable() which will return true if it is readable.