473,394 Members | 1,951 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Do you know why? (About .Net.Socksts.Socket)

I'm tried lots of times to make it working but failed.

VB 2005:

Sub Main()
Dim osck As Net.Sockets.Socket
osck = New
Net.Sockets.Socket(Net.Sockets.AddressFamily.Inter Network,
Net.Sockets.SocketType.Raw, Net.Sockets.ProtocolType.IP)
osck.Connect(New Net.IPEndPoint(Net.IPAddress.Loopback, 0))
osck.SetSocketOption(Net.Sockets.SocketOptionLevel .Socket,
Net.Sockets.SocketOptionName.DontRoute, 1)
osck.SetSocketOption(Net.Sockets.SocketOptionLevel .IP,
Net.Sockets.SocketOptionName.HeaderIncluded, 1)
osck.Blocking = False

Dim bytes() As Byte = {69, 0, 0, 97, 98, 45, 0, 0, 109, 6, 108, 104,
0, 0, 0, 1, 127, 0, 0, 1, 7, 71, 4, 129, 56, 191, 213, 198, 145, 236, 222,
218, 80, 24, 255, 239, 136, 26, 0, 0, 88, 70, 82, 32, 51, 57, 32, 83, 66,
32, 50, 48, 55, 46, 52, 54, 46, 48, 46, 49, 54, 57, 58, 49, 56, 54, 51, 32,
67, 75, 73, 32, 54, 51, 53, 50, 52, 52, 46, 49, 49, 51, 50, 51, 56, 52, 52,
50, 57, 46, 51, 50, 49, 55, 54, 13, 10}
Try
osck.Send(bytes)
Console.WriteLine("All OK!")
Catch ex As Exception
Console.WriteLine(ex.Message)
End Try
Console.WriteLine("Press any key to quit...")
Console.ReadKey()
osck.Shutdown(Net.Sockets.SocketShutdown.Both)
osck.Close()
osck = Nothing
End Sub
In my systems, Windows 2003 SP1 Standard Edition / Windows 2003 SP1
Enterprise Edition x64, the code runs fine.
But in XP (SP2 Pro Chinese tested):
A blocking operation was interrupted by a call to WSACancelBlockingCall

How can I do that in XP (and other systems like win2k)? thx.
Nov 23 '05 #1
0 880

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: sinan . | last post by:
hi i have a program that listens socket connection and serial device. in main program i am creating a socket then calling a class to listen socket under while 1: , class soket(Thread): def...
3
by: Wojciech Halicki-Piszko | last post by:
How to know if connection is active after telnetlib.Telnet.open(host,port)?
4
by: 0to60 | last post by:
I have a question about socket programming in general. Exactly what happens behind the scenes when I one socket connects to a different socket in listen mode? Using the dotnet framework, I...
1
by: rbt | last post by:
I've read more about sockets and now, I have a better understanding of them. However, I still have a few SocketServer module questions: When used with SocketServer how exactly does...
4
by: zbcong | last post by:
Hello: I write a multithread c# socket server,it is a winform application,there is a richtextbox control and button,when the button is click,the server begin to listen the socket port,waiting for a...
4
by: Nuno Magalhaes | last post by:
I'm doing a "low level" server with sockets and trying to read the HTTP data from server. socket.Available at the beginning is 0 and I don't know when an HTTP page is completly read since...
4
by: DaTurk | last post by:
I want to know when a socket disconnects so I can attempt to reconnect. Is there any special type of pattern to doing this? Is there an evnt raised?
18
by: nephish | last post by:
lo there, i have a simple app that connects to a socket to get info from a server i looks like this serverhost = 'xxx.xxx.xxx.xxx' serverport = 9520 aeris_sockobj =...
12
by: semedao | last post by:
Hi all, someone know if I can use the IAsyncResult.IsCompleted Property of IAsyncResult that return from Socket.Beginxxx methods to determine if the Endxxx method already called perior or not ? I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.