Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Swing Buffers

Status
Not open for further replies.

sweep123

Technical User
Joined
May 1, 2003
Messages
185
Location
GB
I have a task that uses a buffer to send/recv data via TCP/IP sockets. But I think that the buffer is not read fast enough before the next send/recv. Problem with the delay between next send/recv.

How would swing buffers help? As that was suggested as a solution.
 
>> I have a task that uses a buffer to send/recv data via >> TCP/IP sockets

You need to clarify what that means. I use buffers all day and twice on Sunday to send/recv data via TCP/IP sockets without any problems. [bugeyed]


-pete
 
The problem I have is that after a few seconds (around 5 seconds) I get the Winsock error 10014 Bad Address.

However when I look at the pointer that the TCP send is using it is NULL.

The pointer points to a structure that I wish to transmit via non-blocking sockets. Some of the structure contains static data and some dynamic.

However if I reset the pointer:-
prt_MyData = &MyData; // do this just before the send

then the dynamic data is OK (just loaded in), but the static parts of the data are now undefined. i.e. I have lost the initialisation I did on the static sections.

Now using cyclic buffers (10 of them).

I dont understand what TCP/IP is doing with the buffer I use for writing.

If I do this:-

MyStruct MyData;
prt_MyData *MyStruct;

Set up the static bits of MyData ...

prt_MyData = & MyData;

do other processing (get TCP message requesting the send data)

send the data ... // This is where I get the 10014 error.

However if I do the following:-

MyStruct MyData;
prt_MyData *MyStruct;

Set up the static bits of MyData ...

do other processing (get TCP message requesting the send data)

prt_MyData = & MyData; // !!! static data is now undefined
send the data ... // This is where I get the 10014 error.

Help!

 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top