SciAbstractSocket>>#accept: not setting the socket address

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

SciAbstractSocket>>#accept: not setting the socket address

rjuli...@gmail.com
Me again....

I apologize for all of the socket-related questions I have had, with switching to VA 9.
But I have another.....


My product has a client and a server.  The clients send messages to the server over TCP/IP,
by creating a socket to the server.

The server listens for incoming connections, by sending #accept: to its socket
(instantiated by SciSocket newStreamSocket).  The argument passed into #accept:
is supposed to be a new instance of SciSocketAddress, which gets
"updated with information about the connecting socket" (according to the method comment).

When my server picks up a message over this socket, it logs the address of the sender,
by sending #asString to the socketAddress that I passed to #accept:.

In VA9, this is now giving me back: "EINVAL (10022): Invalid argument".
When I inspect the socketAddress, family = 2, but all other instance variables are nil.

So...it makes me think that #accept: is no longer setting the information in the socketAddress
argument.


I hope this all makes sense.

Anyone with some insight?

Regards,
Julian

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: SciAbstractSocket>>#accept: not setting the socket address

Noschvie
Hi Julian

We are using #getPeerName to get information about the connecting socket. And yes, in VA 9.1.1 address and port of aClientSocketAddress are nil after used by #accept:
We never use aClientSocketAddress after #accept:

aClientSocketAddress := SciSocketAddress new.
aClientSocket := self serverSocket accept: aClientSocketAddress.

aClientSocket getPeerName
->
NetworkAddress <172.23.2.124  -  Port 51490  Family 2>

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: SciAbstractSocket>>#accept: not setting the socket address

rjuli...@gmail.com
That worked perfectly.

Thank you, Norbert!!

Regards,
Julian


On Wednesday, November 21, 2018 at 6:04:58 AM UTC-5, Norbert Schlemmer wrote:
Hi Julian

We are using #getPeerName to get information about the connecting socket. And yes, in VA 9.1.1 address and port of aClientSocketAddress are nil after used by #accept:
We never use aClientSocketAddress after #accept:

aClientSocketAddress := SciSocketAddress new.
aClientSocket := self serverSocket accept: aClientSocketAddress.

aClientSocket getPeerName
->
NetworkAddress <172.23.2.124  -  Port 51490  Family 2>

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/d/optout.