Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# Linux WebService
Hi,
 
I hope someone can follow all this because I am having a problem with it all, so please feel free up insert correct terminology and correct concepts I have got wrong. Ok - here goes:
 
I have an application that sends 'jobs' to a linux machine via an apache web service. It's pretty slow so I took some time to speed it up but I'm now hitting the wall with regards to the linux machines free ports. There are <30k ports available with a keep_alive time of 2 hours. I am looking onto changing this to increase available ports and reducing the keep_alive time but there are other machines that require the keep alive time to be longer than I had hoped. not quite 2 hours but long enough that I may well hit the wall in the future.
 
The question at it's core is 'What do I do to solve this?', but hopefully I have broken that down with these two questions:
1: Is there a way keep using a single port for each subsequent request?. Or...
2: Is there a way that I can tell the linux machine to close the port when I'm done with it?
 
I have limited access to the linux machine and limited scope to change it's behavour, but it is do-able if that would be the only (or very much best) solution.
 
I don't really know what search terms to look for so I haven't been able to find much in the way of online articles so any help there would be very much appreciated.

Thanks
G
 
PS: I spoke to another techie here and he says I should mention that the webservice is defined in a wsdl that specifies a port:
 
  <wsdl:binding name="JobservBinding" type="tns:JobservPort">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc" />
    <wsdl:operation name="addxec">
<!--etc...--!>
 
But this again confuses me :?
 

PS exact error
"Only one usage of each socket address (protocol/network address/port)\r\nis normally permitted 10.:80"
Posted 29-Apr-13 0:35am
Edited 29-Apr-13 3:09am
v3

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You seem to have a design flaw here. Do you have 30+K active connections that must remain active?
 
If you just connect, send something and disconnect, but the server keeps the socket opened, this means that you close client socket in the wrong way. You need to perform correct shutdown of the TCP socket before disconnection. If you forcefully close the socket without shutting it down, the server has no way to know that the socket was closed, and keeps his side of the socket opened.
  Permalink  
v2
Comments
Andy Lanng at 29-Apr-13 6:36am
   
sure, but how :S
at the moment the webservice is specified in c# via a wsdl file. Should I hand-write something that allows me to handle the ports?
PS: more info. added to question.
PPS. no the connections do not need to remain active. I am setting up a test linux machine vm clone so that I can see where this error message is actually coming from; the linux server of windows client
Eugene Mayeski at 29-Apr-13 6:43am
   
Unfortunately I don't know how exactly the web service is accessed, so I can't recommend anything besides using some other web service client to establish connection and transfer data.
Andy Lanng at 8-May-13 6:21am
   
Oh, thanks for getting back. I ended up adding a new perl service to take in a csv of parameters.
The error was a TCP/IP Exhaustion Error. The ports are being open / closed correctly but Windows can't cope with such a high volume throughput :S
 
thanks tho ^_^

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Marcin Kozub 275
1 OriginalGriff 264
2 Sergey Alexandrovich Kryukov 215
3 Praneet Nadkar 197
4 Richard MacCutchan 182
0 OriginalGriff 8,048
1 Sergey Alexandrovich Kryukov 7,287
2 DamithSL 5,614
3 Manas Bhardwaj 4,986
4 Maciej Los 4,910


Advertise | Privacy | Mobile
Web04 | 2.8.1411023.1 | Last Updated 29 Apr 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100