Sockets

E

elziko

I have made a simple clint/server system using sockets. I have the client
running on a PocketPC (not that thats important) and a server that listens
for a connection attempt from ther client and can recieve some bytes.

What I want to do now is change this to some sort of bi-directional comms.
Whats the best way to do this? Do I need to create a listener on the client
too listening on a different port? This, I guess, would make both apps a
client and a server. Or is there some other better way of doing it?
Obviously I cant use remoting!
 
T

Tom Shelton

I have made a simple clint/server system using sockets. I have the client
running on a PocketPC (not that thats important) and a server that listens
for a connection attempt from ther client and can recieve some bytes.

What I want to do now is change this to some sort of bi-directional comms.
Whats the best way to do this? Do I need to create a listener on the client
too listening on a different port? This, I guess, would make both apps a
client and a server. Or is there some other better way of doing it?
Obviously I cant use remoting!

--

Cheers,

elziko

I'm a little unclear as to what your trying to accomplish... Can you be
a little more specific. What to you mean bi-directional? Do you mean
that both ends have to accept connetions? Or do you simply mean, client
connects, get's response, sends data, gets response....?

Maybe, I'm dense - but it is important that others understand your
problem before making suggestions :)

Tom Shelton
 
E

elziko

Do you mean
that both ends have to accept connetions?

Yeah each app must be able to send data to the other when it sees fit. I
have started the way I described (having a listener in each app). However,
the connection still only works in one direction since one of the apps is
'Actively refusing' the connection.

Before I ask for anymore help am I doing this the correct way?
 
T

Tom Shelton

Yeah each app must be able to send data to the other when it sees fit. I
have started the way I described (having a listener in each app). However,
the connection still only works in one direction since one of the apps is
'Actively refusing' the connection.

Before I ask for anymore help am I doing this the correct way?

--

Cheers,

elziko

Well a socket is a two stream of data. Both ends, once the connection
is established can send and recieve over the same socket... But a lot
depends on what kind of data, and what kind of program. I am probably
sounding dense here - but without knowing what kind of app your trying
to write, I'm having a hard time comming up with suggestions. (I hope
someone else can jump in here and save me before I drown! :)
 
E

elziko

Well a socket is a two stream of data. Both ends, once the connection
is established can send and recieve over the same socket... But a lot
depends on what kind of data, and what kind of program. I am probably
sounding dense here - but without knowing what kind of app your trying
to write, I'm having a hard time comming up with suggestions. (I hope
someone else can jump in here and save me before I drown! :)

Sorry for being so vague... I'm not writing anything in particular, just
trying to get my head round it all. I found that I needed to look into
'BeginReceive' of the socket class to receive data asynchronously and I
found this excellent example:

http://www.developerfusion.com/show/3997/1/

Thanks for your help though.
 
T

Tom Shelton

Sorry for being so vague... I'm not writing anything in particular, just
trying to get my head round it all. I found that I needed to look into
'BeginReceive' of the socket class to receive data asynchronously and I
found this excellent example:

http://www.developerfusion.com/show/3997/1/

Thanks for your help though.

--

Cheers,

elziko

Well, I'm glad you found something to help you... I was really starting
to feel inadequate :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top