| | |
MFC Socket programming problem
![]() |
•
•
Join Date: Dec 2004
Posts: 5
Reputation:
Solved Threads: 0
I have to apologize to the moderators that I was not sure where I should post my question. So if this is wrong fourm feel free to move it to a more suitable place, thank you.
First of all I like to thank everyone here for their help in last thread. My new question is this:
I have a client and server application. I run the client on my laptop and server in desktop. It is simply sending some data from server to client.
This is how I do my send:
pNBaseD->OutputToSocket( pDoc->NetOptionCurrent, pDoc->StaInfo, pDoc->PredStaInfoCurrent, pDoc->MeaAllRaw, m_NetCorr_iPRNArray, m_NetCorr_psNetCorr, m_NetCorr_psPredNetCorr, pDoc->EpochTime, m_pServerSock, &m_cControlMessage );
which will call send at the end.
Problem:
If I put a breakpoint in my client at recive function in debuging mode and make it hang there, my server tries to send data to client. after while , my server hangs in the send and send will never returns.
My guess: ( Please tell me if it is right)
the internal buffer that server writes the data gets full since the client is not reciving. so that is why the send does not return.
Solution:
Is there a function on MFC that I can call to check this internal buffer and if it is full then do not try to write to it and skip the send???
Thank you all. I know this is simple problem for many of you but I am just trying to learn MFC.
First of all I like to thank everyone here for their help in last thread. My new question is this:
I have a client and server application. I run the client on my laptop and server in desktop. It is simply sending some data from server to client.
This is how I do my send:
pNBaseD->OutputToSocket( pDoc->NetOptionCurrent, pDoc->StaInfo, pDoc->PredStaInfoCurrent, pDoc->MeaAllRaw, m_NetCorr_iPRNArray, m_NetCorr_psNetCorr, m_NetCorr_psPredNetCorr, pDoc->EpochTime, m_pServerSock, &m_cControlMessage );
which will call send at the end.
Problem:
If I put a breakpoint in my client at recive function in debuging mode and make it hang there, my server tries to send data to client. after while , my server hangs in the send and send will never returns.
My guess: ( Please tell me if it is right)
the internal buffer that server writes the data gets full since the client is not reciving. so that is why the send does not return.
Solution:
Is there a function on MFC that I can call to check this internal buffer and if it is full then do not try to write to it and skip the send???
Thank you all. I know this is simple problem for many of you but I am just trying to learn MFC.
•
•
Join Date: Dec 2004
Posts: 5
Reputation:
Solved Threads: 0
•
•
•
•
Originally Posted by shahin
I have to apologize to the moderators that I was not sure where I should post my question. So if this is wrong fourm feel free to move it to a more suitable place, thank you.
First of all I like to thank everyone here for their help in last thread. My new question is this:
I have a client and server application. I run the client on my laptop and server in desktop. It is simply sending some data from server to client.
This is how I do my send:
pNBaseD->OutputToSocket( pDoc->NetOptionCurrent, pDoc->StaInfo, pDoc->PredStaInfoCurrent, pDoc->MeaAllRaw, m_NetCorr_iPRNArray, m_NetCorr_psNetCorr, m_NetCorr_psPredNetCorr, pDoc->EpochTime, m_pServerSock, &m_cControlMessage );
which will call send at the end.
Problem:
If I put a breakpoint in my client at recive function in debuging mode and make it hang there, my server tries to send data to client. after while , my server hangs in the send and send will never returns.
My guess: ( Please tell me if it is right)
the internal buffer that server writes the data gets full since the client is not reciving. so that is why the send does not return.
Solution:
Is there a function on MFC that I can call to check this internal buffer and if it is full then do not try to write to it and skip the send???
Thank you all. I know this is simple problem for many of you but I am just trying to learn MFC.
No one knows nothing ??!!!
![]() |
Similar Threads
- Socket Programming... (C#)
- [socket programming] send picture with socket programming (VB.NET)
- Help on socket programming (C++)
- Socket programming in IPv6? (C++)
- Eclipse SDK/Socket Programming help (Java)
- WinDVD MFC Application has encountered a problem and needs to close. We are sorry fo (Windows Software)
- Socket programming + porting Unix to Win32 (C)
Other Threads in the C Forum
- Previous Thread: Big O and little o notations
- Next Thread: I keep writing zero's, not my data using fprintf
| Thread Tools | Search this Thread |
* ansi api array arrays binarysearch calculate centimeter changingto char character convert copyanyfile copypdffile creafecopyofanytypeoffileinc createcopyoffile createprocess() database directory dynamic execv fflush file floatingpointvalidation fork forloop frequency function getlasterror getlogicaldrivestrin givemetehcodez grade graphics gtkgcurlcompiling gtkwinlinux highest histogram homework i/o inches include infiniteloop input interest intmain() iso keyboard km linked linkedlist linux list looping loopinsideloop. lowest matrix microsoft mysql oddnumber open opendocumentformat openwebfoundation pdf pointer posix power program programming pyramidusingturboccodes radix read recursion recv recvblocked repetition reversing scanf scheduling segmentationfault send sequential shape single socketprogramming stack standard strchr string suggestions test threads turboc unix urboc user variable whythiscodecausesegmentationfault win32api windows.h windowsapi





