Vina
10-29-2001, 04:13 PM
Vina have done the following:
Client/Server Model
A. Host program listens for connection requests from the Client. When one is received the Host passes out a port number for the Client to reconnect on. The Host then signals another program (Spawn) to wait for this incoming connection on the specified port. The Host the returns to listening for the next connection request from another Client.
B. Client program initializes a connection request because either
1. He has data to send or
2. He has no data but needs to see if there is data for him.
Once the Client is told where the Spawn program will be waiting the Client disconnects from the Host and attempts a new connection on the port where the Spawn is waiting.
C. Spawn program opens a socket on the port specified and waits for the Client to connect. Once a connection is made a series of transfer can happen.
1. Client send the data then checks for data to be received. Once both are finished the connection is closed.
2. Client doesn't have data but check to see if data is available for him. If so, the data is sent by the Spawn to the Client. Once all transmission is done the connection is closed.
Question #1
When the Client attempts a connection he will know at that time how much data, if any, he has to send over tho the Spawn. Therefore, the Buffersize can be set according to that amount. However, if he has no data to send he does not know what Buffersize to set because he may or may not get data of an unknown size.
What is the better approach? Should the buffersize be a predetermined static size so that no matter how much data is sent either way the buffersize stays one size? Should the socket be reconnected and the buffersize reset according to the data size being sent from either direction?.
Question #2
If it is unknown when data will be available to be sent or received, what is the better approach? Is it best to open and close a socket connection each time I have data or each time I want to see if there is data to receive? Or should the socket be kept open at all times whether there is data or not?
When it is determined that data is available to send or when data needs to be received, that data can be sent or received without having to make a connection, doing security, acknowledgments......first?
Thank you in advanced for all your help. Vina.
Client/Server Model
A. Host program listens for connection requests from the Client. When one is received the Host passes out a port number for the Client to reconnect on. The Host then signals another program (Spawn) to wait for this incoming connection on the specified port. The Host the returns to listening for the next connection request from another Client.
B. Client program initializes a connection request because either
1. He has data to send or
2. He has no data but needs to see if there is data for him.
Once the Client is told where the Spawn program will be waiting the Client disconnects from the Host and attempts a new connection on the port where the Spawn is waiting.
C. Spawn program opens a socket on the port specified and waits for the Client to connect. Once a connection is made a series of transfer can happen.
1. Client send the data then checks for data to be received. Once both are finished the connection is closed.
2. Client doesn't have data but check to see if data is available for him. If so, the data is sent by the Spawn to the Client. Once all transmission is done the connection is closed.
Question #1
When the Client attempts a connection he will know at that time how much data, if any, he has to send over tho the Spawn. Therefore, the Buffersize can be set according to that amount. However, if he has no data to send he does not know what Buffersize to set because he may or may not get data of an unknown size.
What is the better approach? Should the buffersize be a predetermined static size so that no matter how much data is sent either way the buffersize stays one size? Should the socket be reconnected and the buffersize reset according to the data size being sent from either direction?.
Question #2
If it is unknown when data will be available to be sent or received, what is the better approach? Is it best to open and close a socket connection each time I have data or each time I want to see if there is data to receive? Or should the socket be kept open at all times whether there is data or not?
When it is determined that data is available to send or when data needs to be received, that data can be sent or received without having to make a connection, doing security, acknowledgments......first?
Thank you in advanced for all your help. Vina.