Click here to Skip to main content
15,897,704 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Non Ovelapped Serial I/O Pin
korvix3-Aug-09 15:42
korvix3-Aug-09 15:42 
QuestionRe: Non Ovelapped Serial I/O Pin
David Crow3-Aug-09 3:56
David Crow3-Aug-09 3:56 
AnswerRe: Non Overlapped Serial I/O Pin
sunny_vc3-Aug-09 4:53
sunny_vc3-Aug-09 4:53 
QuestionSobel - edge detection Pin
adichavan2-Aug-09 22:22
adichavan2-Aug-09 22:22 
AnswerRe: Sobel - edge detection Pin
HimanshuJoshi2-Aug-09 22:47
HimanshuJoshi2-Aug-09 22:47 
GeneralRe: Sobel - edge detection Pin
adichavan2-Aug-09 23:16
adichavan2-Aug-09 23:16 
GeneralRe: Sobel - edge detection PinPopular
Michael Schubert2-Aug-09 23:57
Michael Schubert2-Aug-09 23:57 
GeneralRe: Sobel - edge detection Pin
Chandrasekharan P3-Aug-09 0:05
Chandrasekharan P3-Aug-09 0:05 
GeneralRe: Sobel - edge detection Pin
adichavan3-Aug-09 1:39
adichavan3-Aug-09 1:39 
GeneralRe: Sobel - edge detection Pin
adichavan3-Aug-09 1:42
adichavan3-Aug-09 1:42 
GeneralRe: Sobel - edge detection Pin
Chandrasekharan P3-Aug-09 2:02
Chandrasekharan P3-Aug-09 2:02 
GeneralRe: Sobel - edge detection Pin
CPallini3-Aug-09 0:37
mveCPallini3-Aug-09 0:37 
QuestionWhich way should I select when save image from browser Pin
shi baoshi2-Aug-09 22:02
shi baoshi2-Aug-09 22:02 
AnswerRe: Which way should I select when save image from browser Pin
Code-o-mat3-Aug-09 0:29
Code-o-mat3-Aug-09 0:29 
GeneralRe: Which way should I select when save image from browser [modified] Pin
shi baoshi3-Aug-09 16:15
shi baoshi3-Aug-09 16:15 
GeneralRe: Which way should I select when save image from browser Pin
Code-o-mat3-Aug-09 21:06
Code-o-mat3-Aug-09 21:06 
GeneralRe: Which way should I select when save image from browser Pin
shi baoshi3-Aug-09 21:45
shi baoshi3-Aug-09 21:45 
GeneralRe: Which way should I select when save image from browser Pin
Code-o-mat3-Aug-09 22:43
Code-o-mat3-Aug-09 22:43 
GeneralRe: Which way should I select when save image from browser Pin
shi baoshi3-Aug-09 23:09
shi baoshi3-Aug-09 23:09 
GeneralRe: Which way should I select when save image from browser [modified] Pin
Code-o-mat3-Aug-09 23:16
Code-o-mat3-Aug-09 23:16 
GeneralRe: Which way should I select when save image from browser Pin
shi baoshi4-Aug-09 4:47
shi baoshi4-Aug-09 4:47 
GeneralRe: Which way should I select when save image from browser Pin
Code-o-mat4-Aug-09 6:14
Code-o-mat4-Aug-09 6:14 
GeneralRe: Which way should I select when save image from browser Pin
shi baoshi4-Aug-09 16:04
shi baoshi4-Aug-09 16:04 
QuestionUDP connection -> outgoing port trouble (still) Pin
Souldrift2-Aug-09 21:39
Souldrift2-Aug-09 21:39 
Good morning,

last week I already wrote about my little problem. Then I got sick and and couldn´t take part in the conversation. Even though I got an answer it didn´t help (or I misunderstood). Now I wanted to ask/clarify and would be glad for some help.

The code:

SOCKET	m_oUDPSocket;
SOCKADDR_IN m_oUDPAddress;

.
.
.

m_oUDPSocket = socket(AF_INET,SOCK_DGRAM,0);
memset(&m_oUDPAddress,0,sizeof(SOCKADDR_IN));
m_oUDPAddress.sin_family=AF_INET;
m_oUDPAddress.sin_port=htons(m_iClientPort);
m_oUDPAddress.sin_addr.s_addr=inet_addr(m_sClientIP.data()); 

.
.
.

int rc=sendto(m_oUDPSocket,(char*)packet,size+12,0,(SOCKADDR*)&m_oUDPAddress,sizeof(SOCKADDR_IN));


The problem: I´d like to send the data via 'sendto' ALWAYS on the same outgoing port.

The question: Where and how do I define this outgoing port? Do I have to create another SOCKADDR_IN with the server port and address and bind it to m_oUDPSocket?

Like this?

SOCKADDR_IN addr;
memset(&addr,0,sizeof(SOCKADDR_IN));
addr.sin_family=AF_INET;
addr.sin_port=htons(desiredPort);
addr.sin_addr.s_addr=INADDR_ANY;
rc=bind(m_oUDPSocket,(SOCKADDR*)&addr,sizeof(SOCKADDR_IN));


Or am I on the wrong path here? And how can I test if it indeed sends from the desired port?

Thanks for any help.

Souldrift
AnswerRe: UDP connection -> outgoing port trouble (still) Pin
pallaka2-Aug-09 22:15
pallaka2-Aug-09 22:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.