以前、Socketが動かなくなったと書いたが具体的にはUDP受信ができないというもんだった。そこで昨日から本格的に調べてたんだが、どうもうまくいかない。というわけで、3.7.1のSocketPluginのソースを眺める。するとUDP受信でsqSocketSendDataBufCountが呼び出されている。なんで!?
どうみても、sqSocketReceiveDataBufCountのような気がするんだが?
後で、最新ソースを
http://squeak.hpl.hp.com/svn/squeak/trunk/platforms
から引っ張ってみて確認しよう。
int sqSocketReceiveUDPDataBufCountaddressportmoreFlag( SocketPtr s, int buf, int bufSize, int *address, int *port, int *moreFlag) { int nRead; if(UDPSocketType != s->socketType) return interpreterProxy->primitiveFail(); /* bind UDP socket*/ sqSocketConnectToPort(s, *address, *port); if(interpreterProxy->failed()) return 0; /* receive data */ nRead = sqSocketSendDataBufCount(s, buf, bufSize); if(nRead >= 0) { *address= ntohl(ADDRESS(s)->sin_addr.s_addr); *port= ntohs(ADDRESS(s)->sin_port); } return nRead; }
どうみても、sqSocketReceiveDataBufCountのような気がするんだが?
後で、最新ソースを
http://squeak.hpl.hp.com/svn/squeak/trunk/platforms
から引っ張ってみて確認しよう。