networking

What's the equivlent code for stringWithContentsOfURL using a NSURLRequest?

Hi, I used to have: NSURL *url = [NSURL URLWithString:escapedUrlString]; NSString *responseString = [NSString stringWithContentsOfURL:url encoding:NSUTF8StringEncoding error:nil]; But, I was reading online that I should probably be using an NSURLRequest instead if I want to add a timeout. The first code works fine, but the second co...

Getting list of blocked websites in proxy server

I want to have a diagnostic to ensure that my application will not be blocked to access the remote server because of the proxy setting. Is there a way to get the list of a blocked websites in proxy server from the client (.NET)? I suppose I could use WebRequest and try to call simple echo method in the server and whether I get a 403 or ...

Using Cocoa / Objective-C, get currently connected network's security type in Mac OS X

How do I get the security type (and other information) of the currently connected network in Airport in my Objective-C / Cocoa program? ...

Socket getting created with same IP and port on local host.

Hi All, I am seeing weird behavior on Linux where I am seeing that remote end and local end are both showing same IP and port combination. Following is the netstat output netstat -anp | grep 6102 tcp 0 0 139.185.44.123:61020 0.0.0.0:* LISTEN 3361/a.out tcp 0 0 139.185.44.123:61021 ...

Convert hexadecimal to octet format

Hi, the ifconfig output of my machine is the following: :~ shell$ ifconfig en0 en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500 ether 00:25:bc:e7:39:6a inet6 fe80::225:bcff:fee7:396a%en0 prefixlen 64 scopeid 0x4 inet 10.170.133.45 netmask 0xffffff00 broadcast 10.170.133.255 media: autoselect (100...

AsyncSocket and CFSocket, how to set TCP's Urgent Flag?

I'm using AsyncSocket to write a TCP client on iPhone and need to set the Urgent Flag of TCP segments. How to do it? I can't find relative APIs in CFSocket. Thanks. ...

In Windows OS, some background process consuming 75 MB Network data ( BroadBand wastage) everyday. How can I find that background process ?

I am using limited BroadBand ( I can use up to 3GB per month). BroadBand company charges extra money if I use beyond 3 GB. Everyday one ( or more) background process utilizing 75 MB of Internet Data. I have been monitoring Internet data usage through NET METER tool. Initially I suspected AVG anti virus S/W so I uninstalled it, but i...

How to determine if a network path is available or not (online or offline)?

Using .NET / C#, how to determine if a network path (e.g. \mymachine\myfolder) is available or not (online or offline)? Is there a way to be notified by WMI of such event? Thanks! ...

Question about TCP and how to assemble TCP segments meaningfully

Hi, When an application such as a web server sends HTTP data to a web browser, how does the browser know when it has received all of the data so that it can begin using it instead of waiting for more? TCP doesn't specify anywhere how large a segmented message is going to be. Right now I'm thinking that it's up to the application layer...

how to you toggle on and off a web proxy in os x from the command line

In OS X, you turn on and off a web proxy from System Preferences > Network > Proxies, by checking Web Proxy (HTTP) and designating the Web Proxy Server etc. and by clicking OK and then "Apply". This is way too many steps. Is there a way to do this all from the command line and a shell script? ...

Getting notified when the network connection changes in a Cocoa / Obj-C application

Is there any way to be notified / have your Cocoa application listen for changes in the network connection (disconnect, connect, etc.)? How does something like HardwareGrowler do it? ...

Shared MySQL database for ASP.NET and Java

I recently developed a Java Application for a client with MySQL database. Now he wants to have ASP.NET website connected with the Java Application. I'm thinking of placing the database on a local server which would support both the desktop application and the website. What i want to know is, is it the good way to handle these kind of s...

How can I fix conflicts of server received RTSP messages on TCP communication?

Hi guys, I would like to have some advices because I've got conflict between clients sending RTSP messages to the server. First at all I apologize to you all for my English. Well, what I'm doing is a java streaming video application. clients set TCP connection with the server for exchanging RTSP messages server sends over UDP, to t...

join/leave multicast group using libpcap

Hello, I need to receive a multicast stream but filter incoming packets by source MAC address on CentOS 5.5. I'm planning to use libpcap library. Is it possible to join/leave multicast group using libpcap? If yes, how to do that? Thanks ...

Are there different ports for output and input?

When sending data using UDP, a destination port is needed to be specified. If sending by TCP, a source port should also be specified. Are there different ports for input and output? E.g., if I specify port 1234, can I use it for both input and output or should I use different ports for output and input? EDIT: To clarify my question: -...

Flush Socket blocks the call in non blocking SocketHi

Hi All I am using a non blocking Socket for sending messages.We were getting EGAIN error occassioanally .So I have decided to use Flush(socket) to flush the buffer and make space for new space so that i can avoid EGAIN error .But the problem is Flush(socket) is stuck for indefinite time . Here is the code int res = send(socket, bu...

When we can get EGAIN error

Hi I am using a non blocking socket .But while sending messages I am gettng EAGAIN error occasionally. Can you please tell me what are the situation we may get EGAIN error .As I have set the buffer size also with good amount of value .And i am just sending 18 messages of 20 bytes.So I dont think its giving EGAIN because of buffer full.A...

Virus-scanner-proxy and automated downloads

My company uses a proxy that automatically scans downloaded files for viruses. The user is forwarded to a page showing the download and scan progress. When it's done you can download the file. It's highly annoying but scanning all (there are whitelists too though) incoming data is non-negotiable requirement. While this is only "annoying...

What mobile network types allow http traffic during phone calls?

Would this Android code be a correct way to test for http network availability during a phone call, or does it exclude networks that should be included or vice versa: public boolean isOnline() { TelephonyManager tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE); if (tm.getNetworkType() > Telephon...

How can I disable PXE network booting through vSphere on a virtual machine running on VMware ESXi 4.1.0 as host??

How can I disable PXE network booting through vSphere on a virtual machine running on VMware ESXi 4.1.0 as host? ...