Click here to Skip to main content
15,887,683 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
GeneralRe: UDP connection -> outgoing port trouble (still) Pin
Souldrift2-Aug-09 22:22
Souldrift2-Aug-09 22:22 
GeneralRe: UDP connection -> outgoing port trouble (still) Pin
harold aptroot3-Aug-09 0:04
harold aptroot3-Aug-09 0:04 
GeneralRe: UDP connection -> outgoing port trouble (still) Pin
Souldrift3-Aug-09 2:04
Souldrift3-Aug-09 2:04 
QuestionWriting data to Database from Pure C++ Pin
Pardhu_M2-Aug-09 21:25
Pardhu_M2-Aug-09 21:25 
AnswerRe: Writing data to Database from Pure C++ Pin
N a v a n e e t h2-Aug-09 21:56
N a v a n e e t h2-Aug-09 21:56 
AnswerRe: Writing data to Database from Pure C++ Pin
CPallini2-Aug-09 22:03
mveCPallini2-Aug-09 22:03 
AnswerRe: Writing data to Database from Pure C++ Pin
kilt3-Aug-09 3:31
kilt3-Aug-09 3:31 
AnswerRe: Writing data to Database from Pure C++ Pin
Nemanja Trifunovic3-Aug-09 4:20
Nemanja Trifunovic3-Aug-09 4:20 
QuestionTabbing stop when focus go to Cancel button in MFC Screen Pin
MohammedAyaz Shaikh2-Aug-09 21:07
MohammedAyaz Shaikh2-Aug-09 21:07 
QuestionRe: Tabbing stop when focus go to Cancel button in MFC Screen Pin
David Crow3-Aug-09 3:58
David Crow3-Aug-09 3:58 
Questionhow to fetch excel data Pin
trioum2-Aug-09 21:00
trioum2-Aug-09 21:00 
AnswerRe: how to fetch excel data Pin
CPallini2-Aug-09 21:19
mveCPallini2-Aug-09 21:19 
AnswerRe: how to fetch excel data Pin
David Crow3-Aug-09 4:00
David Crow3-Aug-09 4:00 
QuestionTab order does not work properly in MFC Screen. Pin
MohammedAyaz Shaikh2-Aug-09 20:58
MohammedAyaz Shaikh2-Aug-09 20:58 
AnswerRe: Tab order does not work properly in MFC Screen. Pin
Chandrasekharan P3-Aug-09 1:06
Chandrasekharan P3-Aug-09 1:06 
GeneralRe: Tab order does not work properly in MFC Screen. Pin
MohammedAyaz Shaikh3-Aug-09 1:42
MohammedAyaz Shaikh3-Aug-09 1:42 

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.