dbTalk Databases Forums  

SOCKET QUESTIONS

comp.databases.pick comp.databases.pick


Discuss SOCKET QUESTIONS in the comp.databases.pick forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
MVGuru
 
Posts: n/a

Default SOCKET QUESTIONS - 04-26-2007 , 06:22 PM






when I run a program I everything works correctly.
when i run a seperate session and run another instance of the program
I get error 29 Descriptor socket is not valid

if i open multiple sessions after that i get the same error as above.

I am under the impression that socket can handle multiple connections


system: unidata on Ibm aix


Reply With Quote
  #2  
Old   
Symeon
 
Posts: n/a

Default Re: SOCKET QUESTIONS - 04-27-2007 , 03:20 AM






On Apr 27, 12:22 am, MVGuru <aivaz... (AT) cinci (DOT) rr.com> wrote:
Quote:
when I run a program I everything works correctly.
when i run a seperate session and run another instance of the program
I get error 29 Descriptor socket is not valid

if i open multiple sessions after that i get the same error as above.

I am under the impression that socket can handle multiple connections

system: unidata on Ibm aix
A bit more info is needed here - are you writing a socket listening
program or a client oepneing a socket to a server and sending
information, maybe some code examples would help.


Rgds
Symeon.



Reply With Quote
  #3  
Old   
MVGuru
 
Posts: n/a

Default Re: SOCKET QUESTIONS - 04-27-2007 , 10:00 AM



On Apr 27, 4:20 am, Symeon <syme... (AT) gmail (DOT) com> wrote:
Quote:
On Apr 27, 12:22 am, MVGuru <aivaz... (AT) cinci (DOT) rr.com> wrote:

when I run a program I everything works correctly.
when i run a seperate session and run another instance of the program
I get error 29 Descriptor socket is not valid

if i open multiple sessions after that i get the same error as above.

I am under the impression that socket can handle multiple connections

system: unidata on Ibm aix

A bit more info is needed here - are you writing a socket listening
program or a client oepneing a socket to a server and sending
information, maybe some code examples would help.

Rgds
Symeon.
the server side is running as listening and the client is opening the
socket to the server a single client works fine the second and further
instances of the client fail with error 29




Reply With Quote
  #4  
Old   
MVGuru
 
Posts: n/a

Default Re: SOCKET QUESTIONS - 04-27-2007 , 12:16 PM



On Apr 27, 11:35 am, "Glen B" <no$pamwebmaster@no$pamforallspec.com>
wrote:
Quote:
This is a generalized response, not MV specific:

A single socket can not handle multiple connections. Each outgoing(
connect() ) or incoming( accept() ) connection is assigned a file descriptor
for reading and writing to a remote. The listener is also assigned a single
file descriptor for the sole purpose of binding to a port on an address. It
accepts connections one-at-a-time and then passes them to the accept()
handler. You can not re-use any active socket number, for any purpose other
than its original state. The same is true for any file handle. Also, make
sure that you close socket file handles properly. Don't bail from a socket
app without closing all file handles first. If you don't, you could end up
fubar-ing the network subsystem. *nix is far more forgiving than Windows,
but there is still a possibility that you can "use-up" all available handles
in a threaded or forking architecture and have to reboot your box to fix it.

Glen

"MVGuru" <aivaz... (AT) cinci (DOT) rr.com> wrote in message

news:1177629749.389960.50870 (AT) r30g2000prh (DOT) googlegroups.com...



when I run a program I everything works correctly.
when i run a seperate session and run another instance of the program
I get error 29 Descriptor socket is not valid

if i open multiple sessions after that i get the same error as above.

I am under the impression that socket can handle multiple connections

system: unidata on Ibm aix- Hide quoted text -

- Show quoted text -
I am trying to run multiple client side software to a single socket
listening host server.

Ex:

CLIENT ------------------------> server1

When this instance is run there are no issues.

When subsequent sessions are started it has a socket error of 18 and
then 14 and then 29

Which mean 18 is an ECONNRESET 14 is ESHUTDOWN and 29 is EBADF

The openSocket works correctly, just the writeSocket has the problems
when opening multiple clients and obviously no data comes back from
the server

CLIENT ------------------------> server1

CLIENT ------------------------> server1

CLIENT ------------------------> server1


Theo



Reply With Quote
  #5  
Old   
Symeon
 
Posts: n/a

Default Re: SOCKET QUESTIONS - 04-27-2007 , 02:54 PM



On Apr 27, 6:16 pm, MVGuru <aivaz... (AT) cinci (DOT) rr.com> wrote:
Quote:
On Apr 27, 11:35 am, "Glen B" <no$pamwebmaster@no$pamforallspec.com
wrote:



This is a generalized response, not MV specific:

A single socket can not handle multiple connections. Each outgoing(
connect() ) or incoming( accept() ) connection is assigned a file descriptor
for reading and writing to a remote. The listener is also assigned a single
file descriptor for the sole purpose of binding to a port on an address. It
accepts connections one-at-a-time and then passes them to the accept()
handler. You can not re-use any active socket number, for any purpose other
than its original state. The same is true for any file handle. Also, make
sure that you close socket file handles properly. Don't bail from a socket
app without closing all file handles first. If you don't, you could end up
fubar-ing the network subsystem. *nix is far more forgiving than Windows,
but there is still a possibility that you can "use-up" all available handles
in a threaded or forking architecture and have to reboot your box to fix it.

Glen

"MVGuru" <aivaz... (AT) cinci (DOT) rr.com> wrote in message

news:1177629749.389960.50870 (AT) r30g2000prh (DOT) googlegroups.com...

when I run a program I everything works correctly.
when i run a seperate session and run another instance of the program
I get error 29 Descriptor socket is not valid

if i open multiple sessions after that i get the same error as above.

I am under the impression that socket can handle multiple connections

system: unidata on Ibm aix- Hide quoted text -

- Show quoted text -

I am trying to run multiple client side software to a single socket
listening host server.

Ex:

CLIENT ------------------------> server1

When this instance is run there are no issues.

When subsequent sessions are started it has a socket error of 18 and
then 14 and then 29

Which mean 18 is an ECONNRESET 14 is ESHUTDOWN and 29 is EBADF

The openSocket works correctly, just the writeSocket has the problems
when opening multiple clients and obviously no data comes back from
the server

CLIENT ------------------------> server1

CLIENT ------------------------> server1

CLIENT ------------------------> server1

Theo
As Glen says there is more to writing a socket server than opening a
socket. I would advise you read up on TCP/IP and socket
communications. It is not especialy hard, but is a bit tricky (esp in
a non multithreaded environment like u2) to write a socket based
server.

Alternativley you can use some form of middleware that both your
client and server connect to.

Rgds
Symeon



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.