Tobi
2002.08.07, 12:31 PM
Hi folks,
for my game engine I'm currently writing the server/client stuff for multiplayer using OpenTransport.
I use CarbonLib 1.6 and MPW to compile.
In OS 9 server and client work well, but in X the server doesn't work properly. I'm using a connection-based transactionless, asynchronous and blocking endpoint with a notifier.
The endpoint is created successfully but OTBind() won't work. It doesn't return an error, but when I check the endpoint state it is still T_UNBND and not T_IDLE as it should be. This only happens if a pass an address in the OTBind() call like:
TBind binder;
InetAddress ina;
ina.fPort=23;//like telnet
ina.fHost=0;//myself
ina.fAddressType=AF_INET;
binder.qlen=1;//1 outgoing connection request
binder.addr=(UInt8 *)&ina;
binder.len=sizeof(InetAddress);
OTBind(myEndpoint, &binder, NULL);
If I just use OTBind(myEndpoint, NULL, NULL); it works well, but that way I cannot do a server because no address was specified.
I cannot see where the problem is. I've looked at Apple sample code as well as the source of OTChat and the OpenTransport documentation. They use just about the same code and it works.
Any idea what I might be doing wrong???
-Tobi
for my game engine I'm currently writing the server/client stuff for multiplayer using OpenTransport.
I use CarbonLib 1.6 and MPW to compile.
In OS 9 server and client work well, but in X the server doesn't work properly. I'm using a connection-based transactionless, asynchronous and blocking endpoint with a notifier.
The endpoint is created successfully but OTBind() won't work. It doesn't return an error, but when I check the endpoint state it is still T_UNBND and not T_IDLE as it should be. This only happens if a pass an address in the OTBind() call like:
TBind binder;
InetAddress ina;
ina.fPort=23;//like telnet
ina.fHost=0;//myself
ina.fAddressType=AF_INET;
binder.qlen=1;//1 outgoing connection request
binder.addr=(UInt8 *)&ina;
binder.len=sizeof(InetAddress);
OTBind(myEndpoint, &binder, NULL);
If I just use OTBind(myEndpoint, NULL, NULL); it works well, but that way I cannot do a server because no address was specified.
I cannot see where the problem is. I've looked at Apple sample code as well as the source of OTChat and the OpenTransport documentation. They use just about the same code and it works.
Any idea what I might be doing wrong???
-Tobi