anthony.liot Posted June 26, 2014 Share Posted June 26, 2014 Hi, I am working with Unigine Socket and I have some trouble on OSX. I don't think it's a bug, seems more like a limitation from the OS.I have a script class http. This class can make GET / POST / POST MULTIPART / POST FILE and it's working well, ... at least for windows. Our software do some request on php file on our server for upload some screenshot in zip format (500 Ko). The trouble is on windows the upload work, but on OSX everything seems good, the socket it's writing the good size, but after using writeStream, theorically we must be receive a response from the server, and nothing .... Seems like a limitation but I don't yet find where.May be someone on the forum, have bigger expertise in network and can advice me about may be a limitation on OSX socket or other, I will try to use WireShark for see if I can have more info ... Thanks Tony Link to comment
anthony.liot Posted June 26, 2014 Author Share Posted June 26, 2014 Hi have more details about my trouble when I change my code, It's seems related to writeStream, if I change my code using writeChar it's working .... BTW the value return by writeStream it's correct on OS X, also writeStream work sometimes on request more light. // WORKING ON OSX for (int i = 0 ; i < requestBuffer.getSize(); i++) { socket.writeChar(requestBuffer.readChar()); } // NOT WORKING ON OSX socket.writeStream(requestBuffer,requestBuffer.getSize()); Link to comment
unclebob Posted July 8, 2014 Share Posted July 8, 2014 Hey Anthony, Try to play with send buffer size by using Socket::send method (https://developer.unigine.com/en/docs/1.0/scripting/core/class.socket#send_int_int) Link to comment
anthony.liot Posted July 8, 2014 Author Share Posted July 8, 2014 Hi Unclebob, I already play with send, I try with a max buffer size and call socket.writeStream inside a loop writing the same block size. I also try to set the send value with the size of what I want send : send(requestBuffer.getSize()); Unfortuantely no result for now :( Link to comment
unclebob Posted July 9, 2014 Share Posted July 9, 2014 Hello again, Anthony!I think the OS itself may limit send/recv buffer size. I've found pretty interesting topic about this: http://stackoverflow.com/questions/10063497/why-changing-value-of-so-rcvbuf-doesnt-work/10063799#10063799In short, try to change your buffser size values right in the OS settings.For recv buffer you can find them there:proc/sys/net/core/rmem_defaultproc/sys/net/core/rmem_max Link to comment
unclebob Posted July 9, 2014 Share Posted July 9, 2014 Also, if it's not acceptable for you, then I suggest you to split your data to several packets. Link to comment
Recommended Posts